home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ToknTabl.h
-
- Contains: The TokenTable class.
-
- Owned by: Nick Pilch
-
- Copyright: © 1993 - 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <4> 8/19/94 NP 1181622: Ownership fix.
- <3> 7/29/94 CG NameSpace API changes.
- <2> 6/27/94 CG Removed fEv - not thread safe.
- <1> 6/7/94 CG first checked in
- <3> 11/15/93 NP Changed ODSymbols to ODNameSpaceManager.
- <2> 10/28/93 NP GetType returns a boolean instead of
- throwing an exception.
- <1> 10/25/93 NP first checked in
- <4> 8/9/93 NP Added class id string.
- <3> 7/21/93 NP Added a virtual keyword (temporary for
- ASLM).
- <2> 6/23/93 RCR Moved ODTypeToken to ODTypes.h
- <1> 6/22/93 NP first checked in
-
- To Do:
- */
-
- #ifndef _ODTOKNTABL_
- #define _ODTOKNTABL_
-
- #ifndef _PLFMDEF_
- #include "PlfmDef.h"
- #endif
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- //==============================================================================
- // Theory of Operation
- //==============================================================================
-
- /*
- This class keeps a table of ODTypes and their corresponding unique tokens.
- */
-
- //==============================================================================
- // Scalar Types
- //==============================================================================
-
-
- //==============================================================================
- // Classes defined in this interface
- //==============================================================================
-
- class TokenTable;
-
- //==============================================================================
- // Classes used by this interface
- //==============================================================================
-
- class ODValueNameSpace;
- class ODNameSpaceManager;
-
- //==============================================================================
- // ODClass
- //==============================================================================
-
- #define kODTokenTableID "appl:TokenTable$class,1.0.0"
-
- class TokenTable
- {
- public:
-
- TokenTable(ODNameSpaceManager* mgr);
- ODVMethod void Initialize();
- virtual ~TokenTable();
-
- ODVMethod ODTypeToken Tokenize(ODType type);
-
- // Returns a unique token for type. If the type was previously
- // tokenized, the original token is returned. Throws kODErrOutOfMemory
- // if tokenization fails.
-
- ODVMethod void RemoveEntry(ODType type);
-
- // Removes type from the table. If type was not
- // previously tokenized, no error is signalled.
-
- ODVMethod ODBoolean GetType(ODTypeToken token, ODType* type);
-
- // Returns type, given token. If token does not exist in the table,
- // kODFalse is returned. Otherwise, kODTrue is returned.
-
- protected:
-
- ODNameSpaceManager* fNameSpaceManager;
- ODValueNameSpace* fNameSpace;
- ODULong fNextUniqueID;
- };
-
-
- #endif // _ODTOKNTABL_